import http from '@/utils/http'

/***
 * @name banner图列表
 */
export const homeBannerApi = (data) => {
    return http({
        url: 'shop/index/getBanner',
        method: 'POST',
        data
    })
}

/***
 * @name 商品分类列表
 */
export const getCategoryListApi = (data) => {
    return http({
        url: 'shop/category/category',
        method: 'POST',
        data
    })
}

/***
 * @name 商品列表
 */
export const getGoodsListApi = (data) => {
    return http({
        url: 'shop/goods/get_list',
        method: 'POST',
        data
    })
}

/***
 * @name 商品详情
 */
export const getGoodsDetailApi = (data) => {
    return http({
        url: 'shop/goods/getGoodsDetail',
        method: 'POST',
        data
    })
}

/***
 * @name 评价列表
 * @param data.goods_id
 */
export const getEvaListApi = (data) => {
    return http({
        url: 'shop/goods/goods_comment',
        method: 'POST',
        data
    })
}

/***
 * @name 收藏
 * @param data.type 1：店铺；2：商品
 * @param data.id 商品、店铺id
 */
export const collectApi = (data) => {
    return http({
        url: 'shop/collection/collection',
        method: 'POST',
        data
    })
}

/***
 * @name 收藏列表
 * @param data.type 1：店铺；2：商品
 */
export const collectListApi = (data) => {
    return http({
        url: 'shop/collection/myCollection',
        method: 'POST',
        data
    })
}

/***
 * @name 店铺列表
 * @param data.name
 */
export const shopListApi = (data) => {
    return http({
        url: 'shop/shop/get_list',
        method: 'POST',
        data
    })
}

/***
 * @name 店铺详情
 * @param data.shop_id
 */
export const shopDetailApi = (data) => {
    return http({
        url: 'shop/shop/detail',
        method: 'POST',
        data
    })
}

/***
 * @name 获取积分兑换列表列表
 */
export const getGiftListApi = (data) => {
    return http({
        url: 'shop/goods/get_gift_list',
        method: 'POST',
        data
    })
}

/***
 * @name 创建获取订单页面信息
 * @param data.sku_details {num: '', goods_item_id: ''}
 */
export const createGiftOrderApi = (data) => {
    return http({
        url: 'shop/gift_order/confirm_order_page',
        method: 'POST',
        data
    })
}

/***
 * @name 确认积分兑换订单
 */
export const confirmGiftOrderApi = (data) => {
    return http({
        url: 'shop/gift_order/confirm_order',
        method: 'POST',
        data
    })
}

/***
 * @name 积分支付
 */
export const giftPayApi = (data) => {
    return http({
        url: 'payment/pay/pay',
        method: 'POST',
        data
    })
}

/***
 * @name 礼品订单列表
 */
export const giftOrderListApi = (data) => {
    return http({
        url: 'shop/gift_transport/order_list',
        method: 'POST',
        data
    })
}

/***
 * @name 礼品订单详情
 * @param data.order_id
 */
export const giftOrderDetailApi = (data) => {
    return http({
        url: 'shop/gift_transport/order_detail',
        method: 'POST',
        data
    })
}

/***
 * @name 礼品查看物流
 * @param data.order_id
 */
export const giftViewExpressApi = (data) => {
    return http({
        url: 'shop/gift_transport/invoice_look',
        method: 'POST',
        data
    })
}

/***
 * @name 礼品取消订单
 * @param data.order_id
 */
export const giftCancelOrderApi = (data) => {
    return http({
        url: 'shop/gift_transport/cancel_order',
        method: 'POST',
        data
    })
}

/***
 * @name 礼品确认收货
 * @param data.order_id
 */
export const giftConfirmOrderApi = (data) => {
    return http({
        url: 'shop/gift_transport/take_delivery',
        method: 'POST',
        data
    })
}